<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center MyPortrayal_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub MyPortrayal_fd0_0'>
					<view class='flex flex-wrap align-center MyPortrayal_fd0_0_c0'>
						<text class='fu-iconfont2  MyPortrayal_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
							data-url="1">&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='MyPortrayal_fd0_0_c1_c0'>消息</text>
						<image @tap.stop="clearHandle" class="clear" src="@/static/img02/clear.png" alt="" srcset="" />
					</view>
					<view class='flex flex-wrap align-center justify-end MyPortrayal_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!-- web-view 不遮挡导航栏 -->

			<view class="page-content">
				<div class="item" @click="goNext(1)">
					<image class="item-img" src="@/static/img02/gao.png" mode=""></image>
					<div class="item-right">
						<div class="title">平台公告</div>
						<div  class="explain">{{msg?msg:'暂无消息'}}</div>
					</div>
					<div v-if="site_msg" class="num">
						{{site_msg}}
					</div>
				</div>
				<!-- <div class="item">
					<image class="item-img" src="@/static/img02/gao2.png" mode=""></image>
					<div class="item-right">
						<div class="title">系统消息</div>
						<div class="explain">系统升级通知～</div>
					</div>
					<div class="num">
						4
					</div>
				</div> -->
				<div class="item" @click="goNext(2)">
					<image class="item-img" src="@/static/img02/gao3.png" mode="">
					</image>
					<div class="item-right">
						<div class="title">通知消息</div>
						<div v-if="msg_info" class="explain">{{msg_info}}</div>
					</div>
					<div v-if="system_num" class="num">
						{{system_num}}
					</div>
				</div>


			</view>

		</view>
	</page-body>
</template>

<script>
	export default {
		data() {
			return {
				site_msg: "",
				system_num: "",
				msg: "",
				msg_info: ""
			};
		},
		onShow() {
			this.get_student_msg_num()
		},
		methods: {
			async clearHandle() {
				let res = await this.$api.get(global.apiUrls.post68d910395843a, {});

				if (res.data.code != 1) {
					this.$message.info(res.data.msg);
					return
				}

				this.get_student_msg_num()
			},
			async get_student_msg_num() {
				let res = await this.$api.get(global.apiUrls.post68414cba9e017, {});

				if (res.data.code != 1) {
					this.$message.info(res.data.msg);
					return
				}

				this.site_msg = res.data.data.site_msg
				this.system_num = res.data.data.system_num
				this.msg = res.data.data.msg
				this.msg_info = res.data.data.msg_info
			},
			goNext(val) {
				if (val == 1) {
					uni.navigateTo({
						url: "/pages/My/gaoList/gaoList"
					})
				} else if (val == 2) {
					uni.navigateTo({
						url: "/pages/My/newsList/newsList"
					})
				}

			}
		}
	}
</script>

<style lang="scss">
	.page-content {
		.item {
			margin: 0 24rpx;
			padding: 36rpx 0;
			border-bottom: 1rpx solid #EEEEEE;
			display: flex;
			position: relative;

			.item-img {
				width: 96rpx;
				height: 96rpx;
				margin-right: 24rpx;
				flex-shrink: 0;
			}

			.item-right {
				display: flex;
				justify-content: center;
				flex-direction: column;
				width: 70%;
				.title {
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
					line-height: 45rpx;
				}

				.explain {
					font-weight: 400;
					font-size: 28rpx;
					color: #666666;
					line-height: 40rpx;
					margin-top: 11rpx;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					width: 100%;

				}
			}

			.num {
				width: 36rpx;
				height: 36rpx;
				background: #D32A29;
				border-radius: 50%;
				font-weight: 500;
				font-size: 20rpx;
				color: #FFFFFF;
				line-height: 36rpx;
				text-align: center;
				position: absolute;
				top: 66rpx;
				right: 24rpx;
			}

		}
	}

	.page {
		background: #FFFFFF;
		height: 100vh;
	}

	.clear {
		width: 44rpx;
		height: 44rpx;
		margin-left: 16rpx;
	}

	.MyPortrayal_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.MyPortrayal_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.MyPortrayal_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.MyPortrayal_fd0_0_c0 {
		width: 120rpx;
	}

	.MyPortrayal_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.MyPortrayal_flex_1 {
		padding: 24rpx;
	}

	.MyPortrayal_fd1_7_c1_c1_c0 {
		font-size: 24rpx;
		color: rgba(102, 102, 102, 1);
		font-weight: 400;
		line-height: 48rpx;
	}

	.MyPortrayal_fd1_7_c1_c1 {
		background: #f3f6f8;
		border-radius: 16rpx;
		background-size: 100% auto;
		padding: 24rpx;
	}

	.MyPortrayal_fd1_7_c1_c0_c2_c0 {
		font-size: 24rpx;
		color: #333;
		font-weight: 500;
		line-height: 33rpx;
	}

	.MyPortrayal_progress1_fd1_7_c1_c0_c1_c0 {
		background: rgba(20, 94, 253, 1);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
	}

	.MyPortrayal_fd1_7_c1_c0_c1_c0 {
		border: 1px solid rgba(20, 94, 253, 0.1);
		background: rgba(20, 94, 253, 0.10);
		width: 300rpx;
		height: 20rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		background-size: 100% auto;
	}

	.MyPortrayal_fd1_7_c1_c0_c0_c1 {
		color: rgba(20, 94, 253, 1);
		font-size: 32rpx;
		font-weight: 700;
		line-height: 32rpx;
		text-decoration: none;
	}

	.MyPortrayal_fd1_7_c1_c0_c0_c0 {
		font-size: 48rpx;
		line-height: 56rpx;
		font-weight: 700;
		color: rgba(20, 94, 253, 1);
	}

	.MyPortrayal_fd1_7_c1_c0 {
		background: #f3f6f8;
		border-radius: 16rpx;
		background-size: 100% auto;
		padding: 24rpx;
		height: 286rpx;
	}

	.MyPortrayal_linefd1_7_c0 {
		background: #145efd;
		width: 50rpx;
		height: 8rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx;
	}
</style>